package com.jr.dao.impl;

import com.jr.dao.ISalariesDao;
import com.jr.pojo.Salaries;
import com.jr.pojo2.EmpSalUsers;
import com.jr.util.DBHelper;

import java.sql.Timestamp;
import java.util.ArrayList;

public class SalariesDaoImpl implements ISalariesDao {

    DBHelper db = new DBHelper();

    @Override
    public ArrayList<Salaries> selectBySalaries() {
        return null;
    }

    @Override
    public ArrayList<Salaries> selectBySalaries(Salaries salaries) {
        return null;
    }

    @Override
    public int insertSalaries(Salaries salaries) {
        return 0;
    }

    /* 添加员工 时 同时添加 */
    @Override //在
    public int insertSalWithEmp(EmpSalUsers emp) {
        String sqlSal = "insert into salaries values(null,?,null,?,null,null,null,null,null,?,?)";
        Object[] objSal = {emp.getEmployeeId(),emp.getBaseSalary(),new Timestamp(System.currentTimeMillis()),new Timestamp(System.currentTimeMillis())};
        return db.dtUpdate(sqlSal,objSal);
    }

    @Override
    public int updateSalaries(Salaries salaries) {
        return 0;
    }
}
